import { post } from '../http'
import store from '@/store'

// 运单列表
export const getWillBillList = ({
  orderCode,
  billCode,
  billStatus,
  trkCode,
  driver,
  PageIndex,
  arbitrationType, //仲裁类型
  isPlatform,
  PageSize
}) => {
  return post('/FTKJWLHYPT/transoprt/getWayBillList', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          attCode: orderCode,
          wabCode: billCode,
          wabStatus: billStatus,
          trkNo: trkCode,
          drvName: driver,
          fltUuid: store.state.user.FLT_UUID_DX_H,
          arbitrationType: arbitrationType,
          isPlatform: isPlatform
        }
      },
      Orderby: {},
      PageIndex: {
        FTKJWLHYPT: PageIndex
      },
      PageSize: {
        FTKJWLHYPT: PageSize
      }
    }
  })
}

// 编辑运单接口
export const editWillBill = ({
  uuid,
  attCode,
  wabStatus,
  wabUuid,
  wabCode
}) => {
  return post('/FTKJWLHYPT/transoprt/editWayBill', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          attCode,
          uuid: String(uuid),
          lastmodifier: store.state.user.USR_CODE_DX_H,
          wabStatus,
          wabUuid,
          wabCode,
          fltUuid: store.state.user.FLT_UUID_DX_H
        }
      }
    }
  })
}

// 运单动态列表
export const getWillBillStatus = ({
  wabUuid
}) => {
  return post('/FTKJWLHYPT/transoprt/getwabOperationList', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          optEtpId: store.state.user.FLT_UUID_DX_H,
          wabUuid
        }
      },
      Orderbys: {},
      PageIndexs: {
        FTKJWLHYPT: ''
      },
      PageSizes: {
        FTKJWLHYPT: ''
      }
    }
  })
}
